package zyc.service.imple;

import zyc.dao.StudentDao;
import zyc.dao.imple.StudentDaoImple;
import zyc.pojo.Page;
import zyc.pojo.Student;
import zyc.service.StudentService;

import java.util.List;

/**
 * @description:
 * @author: Code-zyc
 * @date: Created in 2020/12/21 14:13
 * @version: v1.0
 * @modified By:
 */
public class StudentServiceImple implements StudentService {
    StudentDao studentDao=new StudentDaoImple();
    @Override
    public List<Student> getstudents(Page page) {
       return studentDao.getallstudents(page);
    }

    @Override
    public void deletestudent(Integer id) {
        studentDao.deletByid(id);
    }

    @Override
    public void updatestudent(Student student) {
        studentDao.updatestudent(student);
    }

    @Override
    public Student getstudentByid(Integer id) {
        return studentDao.getstudentByid(id);
    }

    @Override
    public void creatStudent(Student student) {
        studentDao.creatStudent(student);
    }

    @Override
    public Integer getCount() {
        return  studentDao.getCount();

    }

    @Override
    public Student getstudentBysid(Integer sid) {
        return studentDao.getstudentBysid(sid);
    }

    @Override
    public List<Student> getstudentsByname(String name) {
        return studentDao.getstudentsByname(name);
    }

    @Override
    public List<Student> getstudentsBymath(Double math) {
        return  studentDao.getstudentsBymath(math);
    }

    @Override
    public List<Student> getstudentsByAsc(String type) {
        return studentDao.getstudentsByAsc(type);
    }

    @Override
    public List<Student> getstudentsByDesc(String type) {
        return studentDao.getstudentsByDesc(type);
    }

    @Override
    public Student getstudentBySidPass(Integer sid, String password) {
        return studentDao.getstudentBySidPass(sid,password);
    }
}
